package com.gator.desig_mode.factory;

/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc
 */
public class SimpleFactory {

  //该工厂根据指定参数创建对象
  //a BMW
  //b Benz
  //c Audi
  public Base createCar(String grand) {

    if (grand.equals("a")) {
      return new BMW();
    }
    if (grand.equals("b")) {
      return new Benz();
    }
    if (grand.equals("c")) {
      return new Audi();
    }
    return null;

  }
}
